package team.pwy.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import team.pwy.pojo.entity.VipOrder;

@Repository
public interface VipOrderMapper {

    @Insert("insert into pwy.pwy_vip_order (user_id,order_number,order_price,sec_id) values (#{userId},#{orderNumber},#{orderPrice},#{secId})")
    Integer addOrder(Integer userId,String orderNumber,String orderPrice,Integer secId);

    @Select("select * from pwy.pwy_vip_order where order_number = #{orderNumber}")
    VipOrder findByOrdNum(String orderNumber);

    @Update("update pwy.pwy_vip_order set status = 1 where user_id = #{userid}")
    Integer updateOrderSta(Integer userId);


}
